From 61536d26155dd570b40a609bbf13776ade493f46 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 6 Aug 2004 15:00:39 +0000 Subject: [PATCH] bitkeeper revision 1.1159.2.1 (41139d17RLVEh5iKEyxO0hVWOtdS6Q) Domain ids are 16 bits. --- tools/libxc/xc.h | 2 +- tools/libxc/xc_domain.c | 8 +-- tools/libxc/xc_evtchn.c | 2 +- tools/libxc/xc_linux_build.c | 2 +- tools/libxc/xc_linux_save.c | 2 +- tools/libxc/xc_netbsd_build.c | 2 +- tools/libxc/xc_private.c | 2 +- xen/include/hypervisor-ifs/dom0_ops.h | 50 ++++++++++++------- xen/include/hypervisor-ifs/event_channel.h | 9 ++-- xen/include/hypervisor-ifs/hypervisor-if.h | 4 +- .../hypervisor-ifs/io/domain_controller.h | 22 ++++++-- xen/include/hypervisor-ifs/sched_ctl.h | 3 +- xen/include/xen/sched.h | 2 +- 13 files changed, 71 insertions(+), 39 deletions(-) diff --git a/tools/libxc/xc.h b/tools/libxc/xc.h index 8b7ee33273..b2cf0c67ba 100644 --- a/tools/libxc/xc.h +++ b/tools/libxc/xc.h @@ -149,7 +149,7 @@ int xc_rrobin_global_set(int xc_handle, u64 slice); int xc_rrobin_global_get(int xc_handle, u64 *slice); -#define DOMID_SELF (0x7FFFFFFEU) +#define DOMID_SELF (0x7FFEU) typedef struct { #define EVTCHNSTAT_closed 0 /* Chennel is not in use. */ diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index d389757cee..10017c74fe 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -25,7 +25,7 @@ int xc_domain_create(int xc_handle, op.u.createdomain.cpu = cpu; if ( (err = do_dom0_op(xc_handle, &op)) == 0 ) - *pdomid = (u32)op.u.createdomain.domain; + *pdomid = (u16)op.u.createdomain.domain; return err; } @@ -88,7 +88,7 @@ int xc_domain_getinfo(int xc_handle, op.u.getdomaininfo.ctxt = NULL; /* no exec context info, thanks. */ if ( do_dom0_op(xc_handle, &op) < 0 ) break; - info->domid = (u32)op.u.getdomaininfo.domain; + info->domid = (u16)op.u.getdomaininfo.domain; info->cpu = (op.u.getdomaininfo.flags>>DOMFLAGS_CPUSHIFT) & DOMFLAGS_CPUMASK; @@ -111,7 +111,7 @@ int xc_domain_getinfo(int xc_handle, strncpy(info->name, op.u.getdomaininfo.name, XC_DOMINFO_MAXNAME); info->name[XC_DOMINFO_MAXNAME-1] = '\0'; - next_domid = (u32)op.u.getdomaininfo.domain + 1; + next_domid = (u16)op.u.getdomaininfo.domain + 1; info++; } @@ -129,7 +129,7 @@ int xc_domain_getfullinfo(int xc_handle, op->u.getdomaininfo.ctxt = ctxt; rc = do_dom0_op(xc_handle, op); - if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 ) + if ( ((u16)op->u.getdomaininfo.domain != domid) && rc > 0 ) return -ESRCH; else return rc; diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c index 624f5b1c15..52f7377467 100644 --- a/tools/libxc/xc_evtchn.c +++ b/tools/libxc/xc_evtchn.c @@ -115,7 +115,7 @@ int xc_evtchn_status(int xc_handle, switch ( status->status = op.u.status.status ) { case EVTCHNSTAT_interdomain: - status->u.interdomain.dom = (u32)op.u.status.u.interdomain.dom; + status->u.interdomain.dom = (u16)op.u.status.u.interdomain.dom; status->u.interdomain.port = op.u.status.u.interdomain.port; break; case EVTCHNSTAT_pirq: diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 23ec09cb09..39dd6c3d08 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -440,7 +440,7 @@ int xc_linux_build(int xc_handle, op.u.getdomaininfo.domain = (domid_t)domid; op.u.getdomaininfo.ctxt = ctxt; if ( (do_dom0_op(xc_handle, &op) < 0) || - ((u32)op.u.getdomaininfo.domain != domid) ) + ((u16)op.u.getdomaininfo.domain != domid) ) { PERROR("Could not get info on domain"); goto error_out; diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index c74e209bdc..5fb8f674c4 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -364,7 +364,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT; live_mfn_to_pfn_table = - mfn_mapper_map_single(xc_handle, ~0UL, + mfn_mapper_map_single(xc_handle, 0x7FFFU, PAGE_SIZE*1024, PROT_READ, mfn_to_pfn_table_start_mfn ); } diff --git a/tools/libxc/xc_netbsd_build.c b/tools/libxc/xc_netbsd_build.c index 833a533ab6..41adfa935a 100644 --- a/tools/libxc/xc_netbsd_build.c +++ b/tools/libxc/xc_netbsd_build.c @@ -254,7 +254,7 @@ int xc_netbsd_build(int xc_handle, op.u.getdomaininfo.domain = (domid_t)domid; op.u.getdomaininfo.ctxt = ctxt; if ( (do_dom0_op(xc_handle, &op) < 0) || - ((u32)op.u.getdomaininfo.domain != domid) ) + ((u16)op.u.getdomaininfo.domain != domid) ) { PERROR("Could not get info on domain"); goto error_out; diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 8807f8a9bf..a7c46873ee 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -296,7 +296,7 @@ long long xc_domain_get_cpu_usage( int xc_handle, domid_t domid ) op.u.getdomaininfo.domain = (domid_t)domid; op.u.getdomaininfo.ctxt = NULL; if ( (do_dom0_op(xc_handle, &op) < 0) || - ((u32)op.u.getdomaininfo.domain != domid) ) + ((u16)op.u.getdomaininfo.domain != domid) ) { PERROR("Could not get info on domain"); return -1; diff --git a/xen/include/hypervisor-ifs/dom0_ops.h b/xen/include/hypervisor-ifs/dom0_ops.h index 502c14744d..8cea03fac2 100644 --- a/xen/include/hypervisor-ifs/dom0_ops.h +++ b/xen/include/hypervisor-ifs/dom0_ops.h @@ -19,7 +19,7 @@ * This makes sure that old versions of dom0 tools will stop working in a * well-defined way (rather than crashing the machine, for instance). */ -#define DOM0_INTERFACE_VERSION 0xAAAA0010 +#define DOM0_INTERFACE_VERSION 0xAAAA0011 #define MAX_DOMAIN_NAME 16 @@ -29,7 +29,8 @@ typedef struct { /* IN variables. */ domid_t domain; /* 0 */ - u32 __pad; + u16 __pad0; + u32 __pad1; memory_t max_pfns; /* 8 */ MEMORY_PADDING; void *buffer; /* 16 */ @@ -54,10 +55,11 @@ typedef struct { MEMORY_PADDING; u8 name[MAX_DOMAIN_NAME]; /* 8 */ u32 cpu; /* 24 */ - u32 __pad; /* 28 */ + u32 __pad0; /* 28 */ /* IN/OUT parameters. */ /* If 0, domain is allocated. If non-zero use it unless in use. */ domid_t domain; /* 32 */ + u16 __pad1; /* OUT parameters. */ } PACKED dom0_createdomain_t; /* 36 bytes */ @@ -65,24 +67,28 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ + u16 __pad; } PACKED dom0_destroydomain_t; /* 4 bytes */ #define DOM0_PAUSEDOMAIN 10 typedef struct { /* IN parameters. */ domid_t domain; /* 0 */ + u16 __pad; } PACKED dom0_pausedomain_t; /* 4 bytes */ #define DOM0_UNPAUSEDOMAIN 11 typedef struct { /* IN parameters. */ domid_t domain; /* 0 */ + u16 __pad; } PACKED dom0_unpausedomain_t; /* 4 bytes */ #define DOM0_GETDOMAININFO 12 typedef struct { /* IN variables. */ domid_t domain; /* 0 */ /* NB. IN/OUT variable. */ + u16 __pad; /* OUT variables. */ #define DOMFLAGS_DYING (1<<0) /* Domain is scheduled to die. */ #define DOMFLAGS_CRASHED (1<<1) /* Crashed domain; frozen for postmortem. */ @@ -111,7 +117,8 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ - u32 __pad; /* 4 */ + u16 __pad0; /* 2 */ + u32 __pad1; /* 4 */ /* IN/OUT parameters */ full_execution_context_t *ctxt; /* 8 */ MEMORY_PADDING; @@ -120,6 +127,7 @@ typedef struct { #define DOM0_IOPL 14 typedef struct { domid_t domain; /* 0 */ + u16 __pad; u32 iopl; /* 4 */ } PACKED dom0_iopl_t; /* 8 bytes */ @@ -140,17 +148,17 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ - u8 opcode; /* 4 */ - u8 __pad0, __pad1, __pad2; - u32 in1; /* 8 */ - u32 in2; /* 12 */ - u32 in3; /* 16 */ - u32 in4; /* 20 */ + u8 opcode; /* 2 */ + u8 __pad; + u32 in1; /* 4 */ + u32 in2; /* 8 */ + u32 in3; /* 12 */ + u32 in4; /* 16 */ /* OUT variables. */ - u32 status; /* 24 */ - u32 out1; /* 28 */ - u32 out2; /* 32 */ -} PACKED dom0_debug_t; /* 36 bytes */ + u32 status; /* 20 */ + u32 out1; /* 24 */ + u32 out2; /* 28 */ +} PACKED dom0_debug_t; /* 32 bytes */ /* * Set clock such that it would read after 00:00:00 UTC, @@ -177,6 +185,7 @@ typedef struct { memory_t pfn; /* 0: Machine page frame number to query. */ MEMORY_PADDING; domid_t domain; /* 8: To which domain does the frame belong? */ + u16 __pad; /* OUT variables. */ /* Is the page PINNED to a type? */ u32 type; /* 12: see above type defs */ @@ -200,6 +209,7 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ + u16 __pad; s32 cpu; /* 4: -1 implies unpin */ } PACKED dom0_pincpudomain_t; /* 8 bytes */ @@ -234,6 +244,7 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ + u16 __pad; u32 bus; /* 4 */ u32 dev; /* 8 */ u32 func; /* 12 */ @@ -274,6 +285,7 @@ typedef struct dom0_shadow_control typedef struct { /* IN variables. */ domid_t domain; /* 0 */ + u16 __pad; u32 op; /* 4 */ unsigned long *dirty_bitmap; /* 8: pointer to locked buffer */ MEMORY_PADDING; @@ -289,6 +301,7 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ + u16 __pad; u8 name[MAX_DOMAIN_NAME]; /* 4 */ } PACKED dom0_setdomainname_t; /* 20 bytes */ @@ -296,7 +309,8 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ - u32 __pad; + u16 __pad0; + u32 __pad1; memory_t initial_memkb; /* 8 */ MEMORY_PADDING; } PACKED dom0_setdomaininitialmem_t; /* 16 bytes */ @@ -305,7 +319,8 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ - u32 __pad; + u16 __pad0; + u32 __pad1; memory_t max_memkb; /* 8 */ MEMORY_PADDING; } PACKED dom0_setdomainmaxmem_t; /* 16 bytes */ @@ -314,7 +329,8 @@ typedef struct { typedef struct { /* IN variables. */ domid_t domain; /* 0 */ - u32 __pad; + u16 __pad0; + u32 __pad1; memory_t num; /* 8 */ MEMORY_PADDING; /* IN/OUT variables. */ diff --git a/xen/include/hypervisor-ifs/event_channel.h b/xen/include/hypervisor-ifs/event_channel.h index 5868cab6fd..fd6d0325f8 100644 --- a/xen/include/hypervisor-ifs/event_channel.h +++ b/xen/include/hypervisor-ifs/event_channel.h @@ -19,10 +19,10 @@ #define EVTCHNOP_bind_interdomain 0 typedef struct { /* IN parameters. */ - domid_t dom1, dom2; /* 0, 4 */ + domid_t dom1, dom2; /* 0, 2 */ /* OUT parameters. */ - u32 port1, port2; /* 8, 12 */ -} PACKED evtchn_bind_interdomain_t; /* 16 bytes */ + u32 port1, port2; /* 4, 8 */ +} PACKED evtchn_bind_interdomain_t; /* 12 bytes */ /* * EVTCHNOP_bind_virq: Bind a local event channel to IRQ . @@ -65,6 +65,7 @@ typedef struct { typedef struct { /* IN parameters. */ domid_t dom; /* 0 */ + u16 __pad; u32 port; /* 4 */ /* No OUT parameters. */ } PACKED evtchn_close_t; /* 8 bytes */ @@ -92,6 +93,7 @@ typedef struct { typedef struct { /* IN parameters */ domid_t dom; /* 0 */ + u16 __pad; u32 port; /* 4 */ /* OUT parameters */ #define EVTCHNSTAT_closed 0 /* Chennel is not in use. */ @@ -103,6 +105,7 @@ typedef struct { union { /* 12 */ struct { domid_t dom; /* 12 */ + u16 __pad; u32 port; /* 16 */ } PACKED interdomain; /* EVTCHNSTAT_interdomain */ u32 pirq; /* EVTCHNSTAT_pirq */ /* 12 */ diff --git a/xen/include/hypervisor-ifs/hypervisor-if.h b/xen/include/hypervisor-ifs/hypervisor-if.h index bc8515425a..bb3e1938d7 100644 --- a/xen/include/hypervisor-ifs/hypervisor-if.h +++ b/xen/include/hypervisor-ifs/hypervisor-if.h @@ -193,9 +193,9 @@ #ifndef __ASSEMBLY__ -typedef u32 domid_t; +typedef u16 domid_t; /* DOMID_SELF is used in certain contexts to refer to oneself. */ -#define DOMID_SELF (0x7FFFFFFEU) +#define DOMID_SELF (0x7FFEU) /* * Send an array of these to HYPERVISOR_mmu_update(). diff --git a/xen/include/hypervisor-ifs/io/domain_controller.h b/xen/include/hypervisor-ifs/io/domain_controller.h index 76dd164fcb..da1f2441de 100644 --- a/xen/include/hypervisor-ifs/io/domain_controller.h +++ b/xen/include/hypervisor-ifs/io/domain_controller.h @@ -223,6 +223,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Domain attached to new interface. */ + u16 __pad; u32 blkif_handle; /* 4: Domain-specific interface handle. */ /* OUT */ u32 status; /* 8 */ @@ -237,6 +238,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Identify interface to be destroyed. */ + u16 __pad; u32 blkif_handle; /* 4: ...ditto... */ /* OUT */ u32 status; /* 8 */ @@ -251,6 +253,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Domain attached to new interface. */ + u16 __pad; u32 blkif_handle; /* 4: Domain-specific interface handle. */ memory_t shmem_frame; /* 8: Page cont. shared comms window. */ MEMORY_PADDING; @@ -268,6 +271,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Domain attached to new interface. */ + u16 __pad; u32 blkif_handle; /* 4: Domain-specific interface handle. */ /* OUT */ u32 status; /* 8 */ @@ -277,6 +281,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Identify blkdev interface. */ + u16 __pad; u32 blkif_handle; /* 4: ...ditto... */ blkif_vdev_t vdevice; /* 8: Interface-specific id for this VBD. */ u16 readonly; /* 10: Non-zero -> VBD isn't writeable. */ @@ -288,9 +293,10 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Identify blkdev interface. */ + u16 __pad0; /* 2 */ u32 blkif_handle; /* 4: ...ditto... */ blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */ - u16 __pad; /* 10 */ + u16 __pad1; /* 10 */ /* OUT */ u32 status; /* 12 */ } PACKED blkif_be_vbd_destroy_t; /* 16 bytes */ @@ -299,10 +305,11 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Identify blkdev interface. */ + u16 __pad0; /* 2 */ u32 blkif_handle; /* 4: ...ditto... */ blkif_extent_t extent; /* 8: Physical extent to append to VBD. */ blkif_vdev_t vdevice; /* 28: Interface-specific id of the VBD. */ - u16 __pad; /* 30 */ + u16 __pad1; /* 30 */ /* OUT */ u32 status; /* 32 */ } PACKED blkif_be_vbd_grow_t; /* 36 bytes */ @@ -311,9 +318,10 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Identify blkdev interface. */ + u16 __pad0; /* 2 */ u32 blkif_handle; /* 4: ...ditto... */ blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */ - u16 __pad; /* 10 */ + u16 __pad1; /* 10 */ /* OUT */ u32 status; /* 12 */ } PACKED blkif_be_vbd_shrink_t; /* 16 bytes */ @@ -451,9 +459,10 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Domain attached to new interface. */ + u16 __pad0; /* 2 */ u32 netif_handle; /* 4: Domain-specific interface handle. */ u8 mac[6]; /* 8 */ - u16 __pad; /* 14 */ + u16 __pad1; /* 14 */ /* OUT */ u32 status; /* 16 */ } PACKED netif_be_create_t; /* 20 bytes */ @@ -467,6 +476,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Identify interface to be destroyed. */ + u16 __pad; u32 netif_handle; /* 4: ...ditto... */ /* OUT */ u32 status; /* 8 */ @@ -481,13 +491,14 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Domain attached to new interface. */ + u16 __pad0; /* 2 */ u32 netif_handle; /* 4: Domain-specific interface handle. */ memory_t tx_shmem_frame; /* 8: Page cont. tx shared comms window. */ MEMORY_PADDING; memory_t rx_shmem_frame; /* 16: Page cont. rx shared comms window. */ MEMORY_PADDING; u16 evtchn; /* 24: Event channel for notifications. */ - u16 __pad; /* 26 */ + u16 __pad1; /* 26 */ /* OUT */ u32 status; /* 28 */ } PACKED netif_be_connect_t; /* 32 bytes */ @@ -501,6 +512,7 @@ typedef struct { typedef struct { /* IN */ domid_t domid; /* 0: Domain attached to new interface. */ + u16 __pad; u32 netif_handle; /* 4: Domain-specific interface handle. */ /* OUT */ u32 status; /* 8 */ diff --git a/xen/include/hypervisor-ifs/sched_ctl.h b/xen/include/hypervisor-ifs/sched_ctl.h index 0a07cc8c95..0131cc4bb3 100644 --- a/xen/include/hypervisor-ifs/sched_ctl.h +++ b/xen/include/hypervisor-ifs/sched_ctl.h @@ -52,7 +52,8 @@ struct sched_adjdom_cmd u32 sched_id; /* 0 */ u32 direction; /* 4 */ domid_t domain; /* 8 */ - u32 __pad; + u16 __pad0; + u32 __pad1; union { /* 16 */ struct bvt_adjdom { diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index ef68c443a0..06b6faf6cc 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -155,7 +155,7 @@ struct domain extern struct domain idle0_task; extern struct domain *idle_task[NR_CPUS]; -#define IDLE_DOMAIN_ID (0x7FFFFFFFU) +#define IDLE_DOMAIN_ID (0x7FFFU) #define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->flags)) void free_domain_struct(struct domain *d); -- 2.30.2